<?php
$page = 'admin';
include_once 'header.php';
require_once '../actions/online_functions.php';
if (isset($_GET['enroll'])) {
    extract($_GET);
    enrollCourse($staff_id, $course_id);
    header("location: ?staff_id=$staff_id");
}

$staff_id = $_GET['staff_id'];
$user = new User($staff_id);
?>
<h2>
    Staff: <?php echo $user->username ?>
</h2>

<ul style="text-transform: capitalize">
    <li>Courses progress</li>
    <ul>
        <?php
        $query = "SELECT * FROM courses order by course asc";
        $result = mysql_query($query) or die("Error executing '$query':" . mysql_error());
        while ($row = mysql_fetch_assoc($result)) {
            extract($row);
            echo "<li>$course (" . courseStatus($id, $staff_id) . ")</li><br/>";
        }
        ?>
    </ul>
</ul>


<?php include_once 'footer.php'; ?>